package com.burry.services;

import java.util.List;
import java.util.Map;

import net.sf.json.JSONArray;

import com.burry.db.SQLMachine;

public class SizeService {
	
	public List getAllSizeInfo(){
		String sql = "select * from bu_good_size";
		SQLMachine sqlM = new SQLMachine("default");
		return sqlM.getResultSet(sql);
	}
	
	public List getSizeDetail(String pid){
		String sql = "select * from bu_size_info where code = '"+pid+"'";
		SQLMachine sqlM = new SQLMachine("default");
		return sqlM.getResultSet(sql);
	}
	
	public Map addASize(String pid,String code,String descibe){
		String sql = "insert into bu_size_info values('"+pid+"','"+code+"','"+descibe+"')";
		SQLMachine sqlM = new SQLMachine("default");
		return sqlM.updateResult(sql);
	}
	
	public String getJSONStr(List list){
		JSONArray jsonArray = JSONArray.fromObject(list);  

        return jsonArray.toString();
	}
}
